Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Board config: SPI & I2C config simplifications (1) #14221

Merged
merged 8 commits into from Mar 10, 2020

Conversation

bkueng
Copy link
Member

@bkueng bkueng commented Feb 24, 2020

This brings the 1. iteration from #14156: extending board configs with the new SPI+I2C config.

With this PR the SPI reset and chip-select code uses the new configuration whereas the drivers still use the existing board config.

The SPI address used to be some (arbitrary) board-specific number, which is now set to zero (and allows for extension to multiple instances of the same sensor type on one bus). To avoid having to recalibrate, code was added to do the transition on param import (7e03d4a). Consolidation of separate Accel vs Gyro ID's was done as well.

There's some tricky dependencies during bootup: the board hw detection requires ADC on some boards (v5), and the SPI init requires to know the board version. This leads to some changes in bootup on some of the boards. @davids5 let me know if you see a problem with that (board changes are in 5a986ae).

Other:

  • CPU load increases by ~1% on a pixhawk 2 cube due to the more generic SPI chip-select
  • FLASH usage: ~+800 bytes on v2 (the SPI config for all hw versions)
  • there's a fix for missing IO on pixhawk 2 mini

Tested on these boards (comparing the boot output):

  • pixhawk 4
  • pixhawk 2 mini (V2M)
  • cube 2.0 (V30)
  • mro pixhawk 2 (V2)
  • mro pixracer (+external SPI)
  • nxp/fmuk66-v3
  • durandal
  • kakutef7
  • omnibusf4sd
  • pixhawk 3 pro
  • v5x

Next steps (the PR does not depend on those and can be merged independently):

  • update all drivers
  • remove the old board I2C+SPI configs

@davids5
Copy link
Member

davids5 commented Feb 24, 2020

@bkueng

The SPI address used to be some (arbitrary) board-specific number, which is now set to zero
This was the Nuttx SPI bus number (buss, cs). It was used to ensure (ASSERT) a CS was on the bus it was called for in the Select. It was helpful in boar bring up.

@davids5
Copy link
Member

davids5 commented Feb 24, 2020

There's some tricky dependencies during bootup: the board hw detection requires ADC on some boards (v5), and the SPI init requires to know the board version. This leads to some changes in bootup on some of the boards. @davids5 let me know if you see a problem with that (board changes are in 5a986ae).

I think I do.

stm32_boardinitialize is called very early in INIT; no OS facilities.
it is calling
board_control_spi_sensors_power_configgpio();
board_control_spi_sensors_power(true, 0xffff);

Before the board_app_initialize(uintptr_t arg) which is late in init. is called and determine the HW.

The reasoning for this was to not add delays the start up. (Using the time from OS init as the reset time)

Will this still work correctly?

@bkueng
Copy link
Member Author

bkueng commented Feb 24, 2020

Will this still work correctly?

The way it is now, yes. It configures the GPIO's and accesses the (static) SPI configuration (so it does not access more OS functionality than before). But please have a look at the definitions as well (under platforms/nuttx/src/px4/stm/stm32_common/spi/spi.cpp).

@bkueng bkueng force-pushed the spi_i2c_config_refactoring_boards branch 2 times, most recently from 5e421ae to 97f0281 Compare February 26, 2020 09:15
@bkueng
Copy link
Member Author

bkueng commented Feb 26, 2020

@PX4/testflights can you test this on all boards? Make sure to check that you do not have to recalibrate sensors when flashing this PR. When switching back to master, you will however have to recalibrate.

@dannyfpv
Copy link

tested on pixhawk4 v5 f-450
Modes Tested*

Position Mode: Good.
Altitude Mode: Good.
Stabilized Mode: Good.
Mission Plan Mode (Automated): Good.
RTL: Good.

Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode proceed to switch to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoin activate RTL
Notes:
No issues noted, good flight in general.

pr Log:
https://review.px4.io/plot_app?log=c2050236-6edb-4c77-acbf-6d0ff6469ae3

master log:
https://review.px4.io/plot_app?log=8683d9d1-7b9d-4b27-8275-385306679379

@Junkim3DR
Copy link

Tested on NXP FMUK66 v3

Modes Tested

  • Position Mode: Good.
  • Altitude Mode: Good.
  • Stabilized Mode: Good.
  • Mission Plan Mode (Automated): Good.
  • RTL (Return To Land): Good.

Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode proceed to switch to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoint then trigger RTL.

Notes
No issues noted, good flight in general.

Logs
https://review.px4.io/plot_app?log=7a562fe5-f253-49c8-b693-5bc35422a990

Tested on Pixhawk 3 v4Pro

Modes Tested

  • Position Mode: Good.
  • Altitude Mode: Good.
  • Stabilized Mode: Good.
  • Mission Plan Mode (Automated): Good.
  • RTL (Return To Land): Good.

Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode proceed to switch to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoint then trigger RTL.

Notes
No issues noted, good flight in general.

Logs
https://review.px4.io/plot_app?log=c8254650-1392-4e7a-94fc-de6d030a939f

@jorge789
Copy link

Tested on PixRacer V4

- Modes Tested
Position Mode: Good.
Altitude Mode: Good.
Stabilized Mode: Good.
Mission Plan Mode (Automated): Good.
RTL (Return To Land): Good.
- Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode proceed to switch to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoint then swith RTL..
- Notes
No issues noted, good flight in general.

Log
https://review.px4.io/plot_app?log=048cf1d0-c14a-424d-b4ed-04849f80df04

Nota****In altitude mode, the vehicle did not respect the height that continued to increase in pitch forward.
Master comparison
Log
https://review.px4.io/plot_app?log=1db4f45f-17fc-45ac-84c9-f97c292a0083

@bkueng bkueng force-pushed the spi_i2c_config_refactoring_boards branch 2 times, most recently from ce65c4b to 27dff4b Compare March 2, 2020 15:50
@dagar
Copy link
Member

dagar commented Mar 2, 2020

there's a fix for missing IO on pixhawk 2 mini

The 3DR pixhawk mini? I'm fairly certain it actually does have an IO (the 8 pwm outputs).

@davids5
Copy link
Member

davids5 commented Mar 2, 2020

@bkueng - Spi bus name are Great!

@dagar yes the V2M does have a PIO

@bkueng bkueng force-pushed the spi_i2c_config_refactoring_boards branch from 27dff4b to 80c8ad3 Compare March 3, 2020 10:16
@bkueng
Copy link
Member Author

bkueng commented Mar 3, 2020

The 3DR pixhawk mini? I'm fairly certain it actually does have an IO (the 8 pwm outputs).

Indeed. Something was off then on my test board, it was not able to communicate with the IO.
Anyway, I dropped the commit.

@bkueng bkueng force-pushed the spi_i2c_config_refactoring_boards branch from 80c8ad3 to 9ab45e5 Compare March 3, 2020 10:56
@bkueng
Copy link
Member Author

bkueng commented Mar 9, 2020

@dagar can we get this in?

@davids5
Copy link
Member

davids5 commented Mar 9, 2020

@bkueng @dagar I have the fully instrumented V3 I would like to check the timing of these changes on. I can work on that today.

@dagar
Copy link
Member

dagar commented Mar 9, 2020

@dagar can we get this in?

I'll review it today.

@bkueng @dagar I have the fully instrumented V3 I would like to check the timing of these changes on. I can work on that today.

Thanks @davids5, I might have some related questions while you're in there.

@dagar
Copy link
Member

dagar commented Mar 9, 2020

For now can you at least keep qurt building? Hopefully soon we'll decide to either resurrect Excelsior (ModalAI) or purge it.


} else {
// Making sure the other peripherals are not selected
stm32_gpiowrite(bus->devices[i].cs_gpio, 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider not propagating this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is an option too. I was considering the opposite: dropping the deselect.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bkueng

I was considering the opposite: dropping the deselect.

Do you mean leaving parts selected until another device is selected?

That might be a bad idea, the CS needs to be de-asserted to release the bus and re-asserted for some parts to reset state (address counters) etc

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but since that's a bad idea, let's look into the other option then.

@dagar
Copy link
Member

dagar commented Mar 9, 2020

I'm wondering if we should use this as an opportunity to split fmu-v2 and fmu-v3.

Proposal

  • boards/px4/fmu-v2/src/spi.cpp
    • limit to HW_VER_FMUV2

This would save a little bit of flash and help us identify boards that need bootloader updates.

@dagar dagar added this to the Release v1.11.0 milestone Mar 9, 2020
constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
initSPIBus(SPI::Bus::SPI1, {
initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}),
initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question for later, is there a better way we can handle these cases of "contains one of the following"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do it based on those that use the same CS pin.

initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}),
initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}),
initSPIDevice(DRV_IMU_DEVTYPE_ICM20608, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}),
initSPIDevice(DRV_MAG_DEVTYPE_HMC5883, SPI::CS{GPIO::PortE, GPIO::Pin15}, SPI::DRDY{GPIO::PortE, GPIO::Pin12}), // hmc5983
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I overlooked that one.

@@ -110,7 +110,7 @@ __EXPORT void board_peripheral_reset(int ms)
{
/* set the peripheral and sensor rails off */
stm32_gpiowrite(GPIO_VDD_3V3_PERIPH_EN, 0);
stm32_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, 0);
board_control_spi_sensors_power(false, 0xffff);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we ever not using a busmask of 0xffff?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in V5x

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dagar
Copy link
Member

dagar commented Mar 9, 2020

Overall this looks great. The only blocker I see for merging is the pixracer lis3mdl (#9175) and possibly the fmu-v2/v3 split (unless there's a reason that's a terrible idea).

@davids5
Copy link
Member

davids5 commented Mar 9, 2020

It is cool! Debug wise it can be not really inspectable...but that should be ok because it is perfect!.

image

On V3 I do not see a clean power reset on the sensors from SW. This may be an artifact of the bad HW that bootlooped on Sensor power down. We should fix that herein or a next PR.

The right thing to do is to power off all the sensors in stm32_boardinitialize the power them on in board_app_initialize. This gives us a free 3 ms delay and a clean reset on the sensors.

To overcome the bad HW that wired the FMU and sensor power together, will have to reserve a RTC register for state:Call it RTCn.

0xXXXXXXXX - not any of the below, unknown (first boot)
0xbaddbadd - bad HW
0xb00b0000 - powering off
0xA0A0A0A0 - AOK HW

Then in stm32_boardinitialize check for RTCn == 0xbaddbadd or 0xb00b0000 if so just power on the sensors. This is bad HW! If RTCn is 0xb00b0000 , write RTCn to 0xbaddbadd. This is bad HW and it bootlooped. We should not power it off. It would be nice to log this.

If RTCn is 0xA0A0A0A0 leave it, if not set it to 0xb00b00 turn the power off.

Then in board_app_initialize if RTCn is not 0xbaddbadd, set it to 0xA0A0A0A0 - this is good hw.

Bad HW will boot twice if the RTC battery drains. But it is bad HW so I think that is OK.

@davids5
Copy link
Member

davids5 commented Mar 9, 2020

timing wise. it is a tad slower. But if we have no more ISR driven SPI and all accesses on a bus are serialized. We can dump the setting all CS to 1 and reduce the code to just doing the select. (This is also true for 1 device on a bus.)

This PR:
image

master:
image

davids5
davids5 previously approved these changes Mar 9, 2020
Copy link
Member

@davids5 davids5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bkueng Really nice! Thank you for this! I ran it and instrumented it, and I stepped it. While it is 500ns slower, and a bit harder to inspect in some cases. It million times more readable!

Chip-select and SPI initialization uses the new config, whereas the drivers
still use the existing defines.

The configuration in board_config.h can be removed after all drivers are
updated.
This avoids the need for recalibration, and also cleans up other driver
ID's (merge separate accel/gyro).

The SPI address was previously set to a board-specific (arbitrary) value,
and is now set to 0. This will allow extending for multiple sensors of the
same type on the same bus.
@bkueng
Copy link
Member Author

bkueng commented Mar 10, 2020

Thanks for the reviews.

I added the lis3mdl to pixracer, and added QuRT.

For now can you at least keep qurt building? Hopefully soon we'll decide to either resurrect Excelsior (ModalAI) or purge it.

Yes, but I think that ship has sailed already. If there's indeed anyone supporting it, I'm perfectly fine with that though.

I'm wondering if we should use this as an opportunity to split fmu-v2 and fmu-v3.
Proposal
boards/px4/fmu-v2/src/spi.cpp
limit to HW_VER_FMUV2

That's an option. I'm a bit concerned if it gets flashed to the wrong board and uses the wrong pins.

@dagar dagar merged commit 335623e into master Mar 10, 2020
@dagar dagar deleted the spi_i2c_config_refactoring_boards branch March 10, 2020 14:11
@mrpollo mrpollo mentioned this pull request Mar 16, 2020
@@ -467,18 +467,20 @@ __END_DECLS
// param is a C-interface. This means there is no overloading, and thus no type-safety for param_get().
// So for C++ code we redefine param_get() to inlined overloaded versions, which gives us type-safety
// w/o having to use a different interface
static inline int param_get(param_t param, float *val)
static inline int param_get_cplusplus(param_t param, float *val)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks linking on gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide the error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[691/691] Linking CXX executable bin/px4
FAILED: bin/px4 
: && /home/jake/hexagon/Qualcomm/ARM_Tools/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ --sysroot=/home/jake/hexagon/Qualcomm/ARM_Tools/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc  -O2 -g -DNDEBUG  -fuse-ld=gold   -Wl,--export-dynamic -rdynamic platforms/posix/CMakeFiles/px4.dir/px4muorb_stub.c.o platforms/posix/CMakeFiles/px4.dir/src/px4/common/main.cpp.o platforms/posix/CMakeFiles/px4.dir/apps.cpp.o platforms/posix/CMakeFiles/px4.dir/home/jake/hexagon/Qualcomm/Hexagon_SDK/3.1/libs/common/rpcmem/src/rpcmem.c.o  -o bin/px4 -L/home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/external/Install/lib -Wl,-rpath,/home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/external/Install/lib -Wl,--start-group platforms/posix/src/px4/common/libpx4_layer.a src/lib/parameters/libparameters.a src/modules/uORB/libmodules__uORB.a src/drivers/batt_smbus/libdrivers__batt_smbus.a src/drivers/camera_trigger/libdrivers__camera_trigger.a src/drivers/differential_pressure/ets/libdrivers__ets_airspeed.a src/drivers/differential_pressure/ms4525/libdrivers__ms4525_airspeed.a src/drivers/differential_pressure/ms5525/libdrivers__ms5525_airspeed.a src/drivers/differential_pressure/sdp3x/libdrivers__sdp3x_airspeed.a src/drivers/distance_sensor/cm8jl65/libdrivers__cm8jl65.a src/drivers/distance_sensor/leddar_one/libdrivers__distance_sensor__leddar_one.a src/drivers/distance_sensor/ll40ls/libdrivers__ll40ls.a src/drivers/distance_sensor/ll40ls_pwm/libdrivers__ll40ls_pwm.a src/drivers/distance_sensor/mappydot/libdrivers__mappydot.a src/drivers/distance_sensor/mb12xx/libdrivers__mb12xx.a src/drivers/distance_sensor/pga460/libdrivers__pga460.a src/drivers/distance_sensor/sf0x/libdrivers__sf0x.a src/drivers/distance_sensor/sf1xx/libdrivers__sf1xx.a src/drivers/distance_sensor/srf02/libdrivers__distance_sensor__srf02.a src/drivers/distance_sensor/teraranger/libdrivers__distance_sensor__teraranger.a src/drivers/distance_sensor/tfmini/libdrivers__tfmini.a src/drivers/distance_sensor/ulanding_radar/libdrivers__distance_sensor__ulanding_radar.a src/drivers/distance_sensor/vl53l0x/libdrivers__distance_sensor__vl53l0x.a src/drivers/gps/libdrivers__gps.a src/drivers/pwm_out_sim/libdrivers__pwm_out_sim.a src/drivers/qshell/posix/libdrivers__qshell__posix.a src/drivers/rc_input/libdrivers__rc_input.a src/modules/airspeed_selector/libmodules__airspeed_selector.a src/modules/attitude_estimator_q/libmodules__attitude_estimator_q.a src/modules/camera_feedback/libmodules__camera_feedback.a src/modules/commander/libmodules__commander.a src/modules/dataman/libmodules__dataman.a src/modules/ekf2/libmodules__ekf2.a src/modules/events/libmodules__events.a src/modules/fw_att_control/libmodules__fw_att_control.a src/modules/fw_pos_control_l1/libmodules__fw_pos_control_l1.a src/modules/land_detector/libmodules__land_detector.a src/modules/landing_target_estimator/libmodules__landing_target_estimator.a src/modules/local_position_estimator/libmodules__local_position_estimator.a src/modules/logger/libmodules__logger.a src/modules/mavlink/libmodules__mavlink.a src/modules/mc_att_control/libmodules__mc_att_control.a src/modules/mc_hover_thrust_estimator/libmodules__mc_hover_thrust_estimator.a src/modules/mc_pos_control/libmodules__mc_pos_control.a src/modules/mc_rate_control/libmodules__mc_rate_control.a src/modules/muorb/krait/libmodules__muorb__krait.a src/modules/muorb/test/libmodules__muorb__test__muorb_test.a src/modules/navigator/libmodules__navigator.a src/modules/rc_update/libmodules__rc_update.a src/modules/rover_pos_control/libmodules__rover_pos_control.a src/modules/sensors/libmodules__sensors.a src/modules/simulator/libmodules__simulator.a src/modules/simulator/battery_simulator/libmodules__simulator__battery_simulator.a src/modules/vmount/libdrivers__vmount.a src/modules/vtol_att_control/libmodules__vtol_att_control.a src/systemcmds/esc_calib/libsystemcmds__esc_calib.a src/systemcmds/led_control/libsystemcmds__led_control.a src/systemcmds/mixer/libsystemcmds__mixer.a src/systemcmds/motor_ramp/libsystemcmds__motor_ramp.a src/systemcmds/motor_test/libsystemcmds__motor_test.a src/systemcmds/param/libsystemcmds__param.a src/systemcmds/perf/libsystemcmds__perf.a src/systemcmds/pwm/libsystemcmds__pwm.a src/systemcmds/sd_bench/libsystemcmds__sd_bench.a src/systemcmds/shutdown/libsystemcmds__shutdown.a src/systemcmds/topic_listener/libsystemcmds__topic_listener.a src/systemcmds/tune_control/libsystemcmds__tune_control.a src/systemcmds/ver/libsystemcmds__ver.a src/systemcmds/work_queue/libsystemcmds__work_queue.a -L/home/jake/hexagon/Qualcomm/Hexagon_SDK/3.1/libs/common/remote/ship/UbuntuARM_Debug -lsdsprpc -lpthread -lm -lrt -Wl,--end-group -L/home/jake/hexagon/Qualcomm/Hexagon_SDK/3.1/libs/common/remote/ship/UbuntuARM_Debug -lsdsprpc src/lib/drivers/smbus/libdrivers__smbus.a src/lib/drivers/airspeed/libdrivers__airspeed.a src/lib/drivers/rangefinder/libdrivers_rangefinder.a src/lib/mixer_module/libmixer_module.a src/lib/output_limit/liboutput_limit.a src/lib/rc/librc.a src/lib/airspeed_validator/libAirspeedValidator.a src/lib/ecl/airdata/libecl_airdata.a src/modules/commander/failure_detector/libfailure_detector.a src/modules/commander/Arming/PreFlightCheck/libPreFlightCheck.a src/modules/commander/Arming/ArmAuthorization/libArmAuthorization.a src/modules/commander/Arming/HealthFlags/libHealthFlags.a src/lib/ecl/EKF/libecl_EKF.a src/lib/ecl/geo_lookup/libecl_geo_lookup.a src/modules/ekf2/Utility/libEkf2Utility.a src/modules/fw_pos_control_l1/launchdetection/liblaunchdetection.a src/modules/fw_pos_control_l1/runway_takeoff/librunway_takeoff.a src/lib/tecs/libtecs.a src/modules/mc_att_control/AttitudeControl/libAttitudeControl.a src/modules/mc_hover_thrust_estimator/libzero_order_hover_thrust_ekf.a src/lib/controllib/libcontrollib.a src/modules/mc_pos_control/PositionControl/libPositionControl.a src/lib/flight_tasks/libFlightTasks.a src/lib/flight_tasks/tasks/ManualAltitudeSmoothVel/libFlightTaskManualAltitudeSmoothVel.a src/lib/flight_tasks/tasks/ManualPositionSmooth/libFlightTaskManualPositionSmooth.a src/lib/flight_tasks/tasks/ManualPositionSmoothVel/libFlightTaskManualPositionSmoothVel.a src/lib/flight_tasks/tasks/ManualPosition/libFlightTaskManualPosition.a src/lib/flight_tasks/tasks/AutoLineSmoothVel/libFlightTaskAutoLineSmoothVel.a src/lib/flight_tasks/tasks/AutoMapper/libFlightTaskAutoMapper.a src/lib/flight_tasks/tasks/AutoFollowMe/libFlightTaskAutoFollowMe.a src/lib/flight_tasks/tasks/Auto/libFlightTaskAuto.a src/lib/avoidance/libavoidance.a src/lib/flight_tasks/tasks/Offboard/libFlightTaskOffboard.a src/lib/flight_tasks/tasks/Failsafe/libFlightTaskFailsafe.a src/lib/flight_tasks/tasks/Descend/libFlightTaskDescend.a src/lib/flight_tasks/tasks/Transition/libFlightTaskTransition.a src/lib/flight_tasks/tasks/Orbit/libFlightTaskOrbit.a src/lib/flight_tasks/tasks/ManualAltitudeSmooth/libFlightTaskManualAltitudeSmooth.a src/lib/flight_tasks/tasks/ManualAltitude/libFlightTaskManualAltitude.a src/lib/flight_tasks/tasks/Manual/libFlightTaskManual.a src/lib/flight_tasks/tasks/Utility/libFlightTaskUtility.a src/lib/flight_tasks/tasks/FlightTask/libFlightTask.a src/lib/bezier/libbezier.a src/lib/weather_vane/libWeatherVane.a src/lib/collision_prevention/libCollisionPrevention.a src/modules/mc_pos_control/Takeoff/libTakeoff.a src/lib/hysteresis/libhysteresis.a src/lib/circuit_breaker/libcircuit_breaker.a src/modules/mc_rate_control/RateControl/libRateControl.a src/lib/landing_slope/liblanding_slope.a src/lib/l1/libl1.a src/lib/pid/libpid.a src/lib/airspeed/libairspeed.a src/modules/sensors/data_validator/libdata_validator.a src/modules/sensors/vehicle_acceleration/libvehicle_acceleration.a src/modules/sensors/vehicle_angular_velocity/libvehicle_angular_velocity.a src/modules/sensors/vehicle_air_data/libvehicle_air_data.a src/modules/sensors/vehicle_imu/libvehicle_imu.a src/modules/sensors/sensor_calibration/libsensor_calibration.a src/lib/mag_compensation/libmag_compensation.a src/lib/drivers/accelerometer/libdrivers_accelerometer.a src/lib/drivers/barometer/libdrivers_barometer.a src/lib/drivers/gyroscope/libdrivers_gyroscope.a src/lib/drivers/device/libdrivers__device.a src/lib/drivers/magnetometer/libdrivers_magnetometer.a src/lib/conversion/libconversion.a src/lib/mathlib/libmathlib.a src/lib/battery/libbattery.a src/lib/ecl/geo/libecl_geo.a src/lib/mixer/libmixer.a src/lib/mixer/HelicopterMixer/libHelicopterMixer.a src/lib/mixer/MultirotorMixer/libMultirotorMixer.a src/lib/mixer/NullMixer/libNullMixer.a src/lib/mixer/SimpleMixer/libSimpleMixer.a src/lib/mixer/Mixer/libMixer.a src/lib/tunes/libtunes.a src/lib/version/libversion.a platforms/posix/src/px4/common/libpx4_layer.a src/lib/parameters/libparameters.a src/modules/uORB/libmodules__uORB.a platforms/common/px4_work_queue/libpx4_work_queue.a platforms/posix/src/px4/common/px4_daemon/libpx4_daemon.a platforms/common/libpx4_platform.a src/lib/systemlib/libsystemlib.a src/lib/cdev/libcdev.a platforms/posix/src/px4/common/libpx4_layer.a src/lib/parameters/libparameters.a src/modules/uORB/libmodules__uORB.a platforms/common/px4_work_queue/libpx4_work_queue.a platforms/posix/src/px4/common/px4_daemon/libpx4_daemon.a platforms/common/libpx4_platform.a src/lib/systemlib/libsystemlib.a src/lib/cdev/libcdev.a platforms/common/work_queue/libwork_queue.a boards/atlflight/excelsior/src/libdrivers_board.a src/lib/perf/libperf.a src/lib/parameters/tinybson/libtinybson.a msg/libuorb_msgs.a -lpthread -lm -lrt && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-uorb && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-batt_smbus && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-camera_trigger && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-ets_airspeed && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-ms4525_airspeed && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-ms5525_airspeed && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-sdp3x_airspeed && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-cm8jl65 && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-leddar_one && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-ll40ls && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-ll40ls_pwm && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-mappydot && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-mb12xx && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-pga460 && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-sf0x && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-sf1xx && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-srf02 && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-teraranger && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-tfmini && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-ulanding_radar && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-vl53l0x && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-gps && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-pwm_out_sim && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-qshell && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-rc_input && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-airspeed_selector && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-attitude_estimator_q && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-camera_feedback && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-commander && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-dataman && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-ekf2 && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-send_event && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-fw_att_control && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-fw_pos_control_l1 && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-land_detector && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-landing_target_estimator && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-local_position_estimator && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-logger && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-mavlink && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-mc_att_control && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-mc_hover_thrust_estimator && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-mc_pos_control && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-mc_rate_control && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-muorb && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-muorb_test && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-navigator && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-rc_update && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-rover_pos_control && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-sensors && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-simulator && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-battery_simulator && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-vmount && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-vtol_att_control && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-esc_calib && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-led_control && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-mixer && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-motor_ramp && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-motor_test && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-param && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-perf && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-pwm && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-sd_bench && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-shutdown && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-listener && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-tune_control && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-ver && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-work_queue
../../src/lib/parameters/param.h:473: error: undefined reference to 'param_get'
../../src/lib/parameters/param.h:473: error: undefined reference to 'param_get'
../../src/lib/parameters/param.h:473: error: undefined reference to 'param_get'
../../src/lib/parameters/param.h:473: error: undefined reference to 'param_get'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Makefile:224: recipe for target 'atlflight_excelsior' failed
make: *** [atlflight_excelsior] Error 1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add #define PARAM_IMPLEMENTATION in parameters_shmem.cpp before #include "param.h"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That did the trick. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants